#ifndef _BUOLA_CV_FEATURES_CMATCH_H
#define _BUOLA_CV_FEATURES_CMATCH_H

#include <buola/image/format.h>

#include <opencv2/features2d/features2d.hpp>

namespace buola { namespace cvi {

struct CMatch
{
    CMatch(const cv::DMatch &pM)
        :   mIndex1(pM.queryIdx)
        ,   mIndex2(pM.trainIdx)
        ,   mTrainImage(pM.imgIdx)
        ,   mDistance(pM.distance)      
    {}

    int mIndex1;
    int mIndex2;
    int mTrainImage;
    float mDistance;
};

inline bool operator<(const CMatch &pLH,const CMatch &pRH)
{
    return pLH.mDistance<pRH.mDistance;
}

/*namespace cvi*/ } /*namespace buola*/ }

#endif
